package com.henrybit.dao;

import java.util.List;

import com.henrybit.exception.DBException;

/**
 * DB操作基类<p>
 * @author henrybit
 * @version 1.0
 */
public abstract class BaseDao<T> {
	/**
	 * 查询符合条件的数据列表<p>
	 * @param 对象
	 * @return return a list of object that satisfy the condition<p>
	 * @throws DBException
	 */
	protected abstract List<T> query(T t) throws DBException;
	
	/**
	 * 插入一条数据<p>
	 * @param t
	 * @throws DBException
	 */
	protected abstract void insert(T t) throws DBException;
	
	/**
	 * 更新一条数据<p>
	 * @param t
	 * @return if update success,return true;else false<p>
	 * @throws DBException
	 */
	protected abstract boolean update(T t) throws DBException;
}
